<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <link
    rel="stylesheet"
    href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css"
  />
  <style>
    .v-enter {
      opacity: 0;
    }
    .v-enter-active {
      transition: opacity 5s;
    }
    .v-enter-to {
      opacity: 1;
    }
    .v-leave {
      opacity: 1;
    }
    .v-leave-active {
      transition: opacity 5s;
    }
    .v-leave-to {
      opacity: 0;
    }
    .ma-enter {
      color: red;
    }
    .ma-enter-active {
      transition: color 2s;
    }
    .ma-enter-to {
      color: blue;
    }
    .ma-leave {
      color: blue
    }
    .ma-leave-active {
      transition: color 2s;
    }
    .ma-leave-to {
      color: red;
    }
  </style>
</head>
<body>
  <div id="app">
    <h1>过渡效果</h1>
    <button @click="isShow = !isShow">toggle</button>
    <p>v-xxx是默认的class名，vue会自动添加这些class</p>
    <p>通过transition组件的name属性，可以修改过渡效果的class名</p>
    <transition>
      <p v-show="isShow">我有过渡效果</p>
    </transition>
    <hr>
    <transition name="ma">
      <p v-show="isShow">我也有过渡效果</p>
    </transition>
    <hr>
    <transition
      leave-active-class="animate__bounceIn"
      enter-active-class="animate__bounceOut">
      <p v-show="isShow">我还有过渡效果</p>
    </transition>
  </div>
  <script src="./vue.js"></script>
  <script>
    let vm = new Vue({
      el: '#app',
      data: {
        isShow: true
      }
    })
  </script>
</body>
</html>